<template>
    <div class="easyd-weixin-Box">
        <div class="addIncomeAndExpensesRecordBox">
            <div class="addIncomeAndExpensesRecordBtn" @click="goAddIncomeAndExpensesRecord">
                <i class="fa fa-jpy fa-lg"></i>新增收入记录
            </div>
        </div>
        <div class="incomeAndExpensesRecordInfo">
            <div class="incomeAndExpensesMonth">本月收入：200元</div>
            <div class="incomeAndExpensesHistory" @click="goIncomeAndExpensesHistoryRecord">历史记录</div>
        </div>
        <div class="incomeAndExpensesRecordBox">
            <mt-loadmore
                :top-method="loadTop"
                :bottom-method="loadBottom"
                :bottom-all-loaded="allLoaded"
                ref="loadmore"
            >
            <div class="incomeAndExpensesRecordItem" v-for="i in 8">
                <div class="incomeAndExpensesRecordName">辣条产品（ 1个 ）</div>
                <div class="incomeAndExpensesRecordPrice">99元</div>
                <div class="incomeAndExpensesRecordNote">我是备注信息，我是备注信息，我是备注信息，我是备注信息，我是备注信息，我是备注信息</div>
            </div>
            </mt-loadmore>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return {
            allLoaded : false,
        }
    },
    methods: {
        loadTop() {
            setTimeout(() => {
                this.$refs.loadmore.onTopLoaded();
            }, 2000);
        },
        loadBottom() {
            setTimeout(() => {
                this.allLoaded = true;
                this.$refs.loadmore.onBottomLoaded();
            }, 5000);
        },
        goIncomeAndExpensesHistoryRecord(){
            this.$router.push({
                path : '/incomeAndExpensesHistoryRecord'
            })
        },
        goAddIncomeAndExpensesRecord(){
            this.$router.push({
                path : '/addIncomeAndExpensesRecord'
            })
            
        }
  }
}
</script>

<style lang="stylus" scoped>
@import '~PUBLIC_CSS'
.incomeAndExpensesRecordBox {
    position absolute
    top 110px
    bottom 0px
    left 0px
    right 0px
    padding-left 15px
    padding-right 15px
    box-sizing border-box
    overflow auto
    -webkit-overflow-scrolling : touch;

    .incomeAndExpensesRecordItem {
        width 100%
        height auto
        $itemStyle()
        box-sizing border-box
        padding 10px
        margin-bottom 15px

        .incomeAndExpensesRecordName {
            width 100%
            height 20px
            font-weight 500
        }

        .incomeAndExpensesRecordPrice {
            margin-top 5px
            margin-bottom 5px
            color green
        }

        .incomeAndExpensesRecordNote {
            color #666
        }
    }
}

.incomeAndExpensesRecordInfo {
    width 100%
    height 50px
    padding-left 15px
    line-height 50px
    padding-right 15px
    box-sizing border-box

    .incomeAndExpensesMonth {
        float left
        color green
    }

    .incomeAndExpensesHistory {
        float right
    }
}

.addIncomeAndExpensesRecordBox {
  width: 100%;
  height: 50px;
  padding-left: 15px;
  padding-right: 15px;
  margin-top: 15px;
  box-sizing: border-box;

  .addIncomeAndExpensesRecordBtn {
    width: 100%;
    height: 50px;
    text-align: center;
    line-height: 50px;
    $itemStyle()

    i {
      color: #999;
      font-size: 14px;
      position: relative;
      top: -2px;
      right: 10px;
    }
  }
}
</style>

